<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>JFinal Model详解-Blog案例</title>
<jsp:include page="../header.jsp"></jsp:include>
<div class="container" style="background: #FFF;">
	<div class="page-header">
		<h1>
			JFinal Model详解 分页查询<a href="/model"><span
				style="font-size:12px;color:#CCC;">进入普通版</span></a>
		</h1>
	</div>
	<table class="table table-hover table-bordered">
		<thead>
			<tr>
				<th>序号</th>
				<th>标题</th>
				<th>发布时间</th>
			</tr>
		</thead>
		<c:forEach items="${blogPage.list }" var="b" varStatus="s">
			<tr>
				<td>${s.index+1 }</td>
				<td>${b.title }</td>
				<td>${b.publishTime }</td>
			</tr>
		</c:forEach>
	</table>
	<div class="page pull-right">
		<nav>
			<ul class="pagination">


				<li><a href="/model/paginate?pageNumber=${blogPage.pageNumber>1?blogPage.pageNumber-1:1  }">上一页</a></li>
				
				<c:forEach begin="1" end="${blogPage.totalPage }" varStatus="page">
					<c:choose>
						<c:when test="${blogPage.pageNumber==page.index }">
							<li class="active"><a href="javascript:void(0)">${page.index }</a></li>
						</c:when>
						<c:otherwise>
							<li><a href="/model/paginate?pageNumber=${page.index }">${page.index }</a></li>
						</c:otherwise>
					</c:choose>
				</c:forEach>
				
				<li><a href="/model/paginate?pageNumber=${blogPage.pageNumber<blogPage.totalPage?blogPage.pageNumber+1:blogPage.totalPage  }">下一页</a></li>



			</ul>
		</nav>
	</div>
</div>
<jsp:include page="../footer.jsp"></jsp:include>